<!DOCTYPE html>
<head>
    <title>用户表单</title>

	<!-- 插入列表依赖资源 -->
	<!-- #include /base/meta/base_header -->
	
	<!-- #include /base/meta/date -->
	
	<!-- #include /base/meta/wui -->
	
</head>
<body class="page-content-white selector-page" style="background-color: #fff;">
    <div class="page-container">
        <div class="portlet">      
            <div class="portlet-body">
                <form role="form" id="form">
                	<input type="hidden" id="userId" />
                	<table class="table table-responsive">
                		<tr>
                			<td class="form-td-label">
                				姓名：
                			</td>
                			<td class="form-td-content">
                				<input id="userName" validate="required,onlyDoubleChars" type="text" class="wui-input"/>
                			</td>

                			<td class="form-td-label">
                				部门：
                			</td>
                			<td class="form-td-content">
                                <input id="departmentId" validate="required" type="text" widget-init="selectBox">
                			</td>
                		</tr>
                		<tr>
                			<td class="form-td-label">
                				生日：
                			</td>
                			<td class="form-td-content">
                				<input id="birthday" validate="required" type="text" widget-init="date" />
                			</td>
                			<td class="form-td-label">
                				年龄：
                			</td>
                			<td class="form-td-content">
                				<input id="age" validate="required" type="text" class="wui-input" />
                			</td>
                		</tr>
                		<tr>
                			<td class="form-td-label">
                				体重：
                			</td>
                			<td class="form-td-content">
                				<input id="weight" validate="required" type="text" class="wui-input" />
                			</td>
            			    <td class="form-td-label">
                				状态：
                			</td>
                			<td class="form-td-content">
                				<select id="enable" validate="required" class="wui-select">
                					<option value="">请选择</option>
                					<option value="1">启用</option>
                					<option value="0">禁用</option>
                				</select>
                			</td>
                		</tr>
                		<tr>
                			<td class="form-td-label">
                				备注：
                			</td>
                			<td colspan="3">
                				<textarea id="remark" style="width: 100%; height: 90px" class="wui-input" ></textarea>
                			</td>
                		</tr>
                	</table>
                </form>
            </div>
        </div>
    </div>
    
    <div class="page-foot">
        <div class="form-actions">
            <button type="submit" class="wui-btn wui-btn-blue" id="btnSubmit">保存</button>
            <button type="button" class="wui-btn" id="btnCancel">取消</button>
        </div>
    </div>
    
    <script src="/scripts/demo/user/formController.js?t=1" type="text/javascript"></script>
    <script src="/scripts/demo/user/userService.js?t=1" type="text/javascript"></script>
    
    <script type="text/javascript">

    	// 全局变量
   		var queryParams = wui.getQueryString(); // 请求参数
   		var action = queryParams.action || "add";
   		var userId = queryParams.userId || "";
   		
    	var widgets = {}; 

        $(document).ready(function() {
        	
        	// 加载页面信息
        	loadPageInfo();
    
        	// 给保存按钮添加点击事件
        	$('#btnSubmit').click(function(){
     	    	// 保存或修改用户信息
     	    	saveOrUpdateUser();
            });
           	
        	// 给取消按钮添加点击事件
     	    $('#btnCancel').click(function(){
                // 取消模态窗口
                wui.cancelModalDialog();
            }); 

        })
    </script>
</body>